import 'package:flutter/material.dart';
import 'package:rainflutter/widget/bottom_sheet.dart';
import 'package:rainflutter/widget/button_widget.dart';

class Sheet extends StatefulWidget {
  const Sheet({Key key}) : super(key: key);

  @override
  _SheetState createState() => _SheetState();
}

class _SheetState extends State<Sheet> with SingleTickerProviderStateMixin {
  AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('下弹框')),
      body: SingleChildScrollView(
        child: Column(
          children: [
            EsOutLineButton('选择物流', padding: EdgeInsets.all(8), onTap: () {
              // Get.toNamed(RouteConfig.logisticsTracking);
              // YpBottomSheet.showText(context, ["退出登录"],
              //     title: "请选择操作",
              //     showRedText: true, clickCallback: (index, text) {
              //   print(index);
              //   print(text);
              // });
              YpBottomSheet.showText(context,
                  ['中通', '中通', '中通', '中通', '中通', '中通', '中通', '圆通', "申通", "韵达"],
                  // title: "请选择",
                  // showRedText: true,
                  clickCallback: (index, text, {info}) {
                print(index);
                print(text);
              });
            }),
            EsOutLineButton('选择支付方式', padding: EdgeInsets.all(8), onTap: () {
              YpBottomSheet.showSelect(
                  context,
                  [
                    '操作有误（商品/时间/地址选错了）',
                    '重复下单',
                    "不想要了",
                    "地址信息填写错误",
                    "商品降价",
                    "商品降价",
                    "商品降价",
                    "商品降价",
                    "其他",
                    "商品降价",
                    "商品降价",
                    "商品降价",
                    "商品降价",
                    "其他",
                  ],
                  title: "取消原因",
                  selectIndex: 2, clickCallback: (index, text, {info}) {
                print(index);
                print(text);
              });
            }),
          ],
        ),
      ),
    );
  }
}
